//
//  NSString+Category.h


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (Category)
/* 获取ascll值 */
- (NSInteger)ascllIntValue;
/* 转成密码 */
- (NSString *)pwdString;
/* 转成字典 */
- (NSDictionary *)toDict;
/* 获取随机的uuid */
+ (NSString *)uuid;
// 获取文档目录路径
+ (NSString *)getDocumentPath;
// 获取cache目录路径
+ (NSString *)getCachePath;
/* 是不是文件路径 */
- (BOOL)isExistFilePath;
// 在cache目录下创建一个目录
+ (BOOL)createDirectoryAtCache:(NSString *)dirName;
//判断正确的快递单号
+(BOOL)validateEMSnumber:(NSString *)EMSnumber;
//银行卡显示格式输出
- (NSString *)showRuleBank;
//"08-10 晚上08:09:41.0" ->
//"昨天 上午10:09"或者"2012-08-10 凌晨07:09"
+ (NSString *)changeTheDateString:(NSString *)str;
/* 计算尺寸 */
- (CGSize)sizeWithFont:(UIFont *)font;
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size;
/* 隐藏手机号中间四位 */
- (NSString *)hideFourPhone;

/**
 Html适配
 @return html
 */
- (NSString *)htmlAdaptation;
/* 添加前缀 */
- (NSAttributedString *)addPrefix:(NSString *)prefix sSize:(CGFloat)sSize bSize:(CGFloat)bSize color:(UIColor *)color;
/* 添加后缀 */
- (NSAttributedString *)addSuffix:(NSString *)prefix sSize:(CGFloat)sSize bSize:(CGFloat)bSize color:(UIColor *)color;
/* 文字前面加图片 */
- (NSAttributedString *)addPrefixIcon:(NSString *)iconString;

+ (NSString *)limitFloatValue:(CGFloat)value;

- (NSAttributedString *)htmlString;


#pragma mark --- 将时间转换成时间戳
- (NSString *)getTimestampFromFormatter:(NSDateFormatter *)formatter;

#pragma mark ---- 将时间戳转换成时间
- (NSString *)getTimeFromFormatter:(NSDateFormatter *)formatter;

#pragma mark - 秒转换成时分
+ (NSString *)timeFormatted:(NSInteger)totalSeconds;

/* 获取缩略图地址 */
- (NSString *)thumbnail_200;

/* 给url后面添加参数 */
- (NSString *)appendPamrWithDict:(NSDictionary *)dict;
+ (NSString *)timeStrWithSecend:(NSInteger)secend;
- (NSString *)timeStrMDHM;

/* 添加分享的设备信息 */
- (NSString *)addDeviceInfo;
/* 字符串是否空 */
- (BOOL)isEmpty;
/*获取某个字符串或者汉字的首字母. */
+ (NSString *)firstCharactorWithString:(NSString *)string;
/* 将JSON串转化为字典或者数组 */
+ (id)toArrayOrNSDictionary:(NSString *)jsonData;

+ (NSString *)encodeWithParams:(id)params apiName:(NSString *)apiName;
@end

NS_ASSUME_NONNULL_END
